package a.f.i;

import a.c.ab;
import a.c.bb;
import a.c.k;
import a.c.m;
import a.c.q;
import a.c.v;
import a.c.w;
import a.c.x;
import a.c.z;
import a.d.f;
import a.d.s;
import a.d.t;
import a.f.c.h;
import a.f.d.a.*;
import a.f.d.pb;
import a.f.zc;
import a.i.db;

import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;

import a.f.c.h;
import a.d.t;
import a.d.s;
import a.d.f;

class e
{
  private x a;
  private double[] b;
  private double[] c;
  private double[] d;
  private boolean[] e;
  private double[] f;
  private double g;
  private static final double h = 100.0D;
  
  e(double paramDouble)
  {
    this.g = paramDouble;
  }
  
  public void a(a.f.o paramo, h paramh)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    this.a = db.a();
    Rectangle localRectangle = paramo.d();
    x localx = db.a();
    a.c.n localn = db.b();
    b_ localb_ = new b_(localx, localn);
    Object localObject1 = paramo.v();
    while (((w)localObject1).e())
    {
      localObject2 = ((w)localObject1).d();
      this.a.a(((w)localObject1).d(), -1);
      localObject3 = new d_(null, null, null);
      localx.a(localObject2, localObject3);
      ((w)localObject1).f();
      if (bool1)
      {
        if (!bool2) {}
        q.n = !q.n;
      }
    }
    localObject1 = new e_(localb_);
    Object localObject2 = paramo.c(a.g);
    Object localObject3 = new a.i.y(paramo);
    bb localbb = new bb();
    Object localObject4 = paramo.v();
    label268:
    do
    {
      if (!((w)localObject4).e()) {
        break;
      }
      localObject5 = ((w)localObject4).d();
      if (!bool2) {
        if (paramh.e((a.c.e)localObject5))
        {
          ((a.i.y)localObject3).a((a.c.e)localObject5);
          if (bool2) {
            continue;
          }
          if (!bool1) {
            break label268;
          }
        }
      }
      if (!bool2)
      {
        if (((k)localObject2).getBool(localObject5))
        {
          localbb.add(localObject5);
          ((a.i.y)localObject3).a((a.c.e)localObject5);
        }
        ((w)localObject4).f();
      }
    } while (!bool1);
    localObject4 = paramo.w();
    do
    {
      if (!((m)localObject4).e()) {
        break;
      }
      localObject5 = ((m)localObject4).a();
      if (!bool2)
      {
        if (((a.c.d)localObject5).g()) {
          ((a.i.y)localObject3).a((a.c.d)localObject5);
        }
        ((m)localObject4).f();
      }
    } while (!bool1);
    localObject4 = new a.f.d.n();
    ((a.f.d.n)localObject4).b(30.0D);
    ((a.f.d.n)localObject4).a(paramo, (ac)localObject1, localb_);
    ((a.i.y)localObject3).a(localbb, true);
    Object localObject5 = paramo.w();
    do
    {
      if (!((m)localObject5).e()) {
        break;
      }
      a.c.d locald = ((m)localObject5).a();
      if ((!bool2) && (bool1)) {
        break label453;
      }
      if (!bool2)
      {
        if (locald.g()) {
          ((a.i.y)localObject3).a(locald);
        }
        ((m)localObject5).f();
      }
    } while (!bool1);
    if (!bool2) {
      paramo.a(a.f.d.a.d.K, (k)localObject2);
    }
    label453:
    localObject5 = new a.f.d.a.o(new pb());
    ((a.f.d.a.o)localObject5).a(paramo, (ac)localObject1, localb_);
    paramo.j(a.f.d.a.d.K);
    this.b = new double[((ac)localObject1).a()];
    this.c = new double[((ac)localObject1).a()];
    this.f = new double[((ac)localObject1).a()];
    this.d = new double[((ac)localObject1).a()];
    this.e = new boolean[((ac)localObject1).a()];
    int i = 0;
    label814:
    do
    {
      if (i >= ((ac)localObject1).a()) {
        break;
      }
      vb localvb = ((ac)localObject1).a(i);
      this.b[i] = localRectangle.getMaxY();
      this.c[i] = localRectangle.getMinY();
      int j = 0;
      if (bool1) {
        break label856;
      }
      w localw = localvb.c().l();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        this.f[i] = Math.max(this.f[i], paramo.t(locale));
        this.a.a(locale, i);
        if (bool1) {
          break label814;
        }
        if (!((k)localObject2).getBool(locale))
        {
          j++;
          this.d[i] += paramo.n(locale);
          this.b[i] = Math.min(this.b[i], paramo.q(locale));
          this.c[i] = Math.max(this.c[i], paramo.q(locale) + paramo.t(locale));
          this.f[i] = Math.max(this.f[i], this.c[i] - this.b[i]);
        }
        localw.f();
      } while (!bool1);
      if (!bool2)
      {
        if (j > 0)
        {
          this.e[i] = true;
          this.d[i] /= j;
        }
        i++;
      }
    } while (!bool1);
    if (!bool2) {
      ((a.i.y)localObject3).g();
    }
    label856:
    if (bool2) {
      q.o = !q.o;
    }
  }
  
  public int a(a.c.e parame)
  {
    int i = this.a.getInt(parame);
    return i;
  }
  
  public t a(a.c.e parame, a.f.o paramo, x paramx)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    int i = this.a.getInt(parame);
    if (i < 0) {
      return null;
    }
    Rectangle2D localRectangle2D = a(paramo, parame, paramx);
    double d1 = localRectangle2D.getMinY();
    double d2 = localRectangle2D.getMinY();
    int j = 0;
    int k = i - 1;
    if (k >= 0) {
      if (!bool2) {
        if (this.e[k] != 0) {
          d1 = this.c[k] + this.g;
        }
      }
    }
    while (bool2)
    {
      if (bool2) {
        break label135;
      }
      d2 = this.d[k];
      j = 1;
      if (bool1)
      {
        k--;
        if (!bool1) {
          break;
        }
      }
    }
    label135:
    double d3 = localRectangle2D.getMaxY();
    double d4 = localRectangle2D.getMaxY();
    double d5 = 0.0D;
    int m = i + 1;
    do
    {
      if (m >= this.e.length) {
        break;
      }
      if (bool1) {
        break label243;
      }
      if (this.e[m] != 0)
      {
        d3 = this.b[m] - this.g;
        d4 = this.d[m];
        if (!bool2) {
          if (!bool1) {
            break;
          }
        }
      }
      else
      {
        d5 += this.f[m] + this.g;
        m++;
      }
    } while (!bool1);
    if ((!bool2) && (j == 0))
    {
      label243:
      d1 -= d5;
      d2 -= d5;
      d3 -= d5;
      d4 -= d5;
    }
    if (!bool2)
    {
      if (d3 - d1 > paramo.t(parame)) {
        break label382;
      }
      if (bool2) {}
    }
    else if (d4 - d2 > paramo.t(parame))
    {
      return new t(localRectangle2D.getX(), d2, localRectangle2D.getWidth(), d4 - d2);
    }
    double d6 = (d2 - d4 + paramo.t(parame)) * 0.5D;
    return new t(localRectangle2D.getX(), d2 - d6, localRectangle2D.getWidth(), paramo.t(parame));
    label382:
    return new t(localRectangle2D.getX(), d1, localRectangle2D.getWidth(), d3 - d1);
  }
  
  private Rectangle2D a(a.f.o paramo, a.c.e parame, k paramk)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    s locals = paramo.u(parame);
    int i = 0;
    double d1 = 1.7976931348623157E+308D;
    double d2 = 1.7976931348623157E+308D;
    double d3 = -1.797693134862316E+308D;
    double d4 = -1.797693134862316E+308D;
    w localw = paramo.v();
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        if ((bool2) || (paramk != null))
        {
          if (bool2) {
            continue;
          }
          if (!paramk.getBool(localw.d())) {}
        }
        else
        {
          zc localzc = paramo.k(localw.d());
          d1 = Math.min(d1, localzc.a());
          d2 = Math.min(d2, localzc.b());
          d3 = Math.max(d3, localzc.a() + localzc.c());
          d4 = Math.max(d4, localzc.b() + localzc.d());
          i = 1;
        }
        localw.f();
      } while (!bool1);
    } while (bool2);
    if (i != 0) {
      return new Rectangle2D.Double(d1 - this.g - locals.b() - 100.0D, d2 - this.g - locals.c() - 100.0D, d3 - d1 + 2.0D * (this.g + 100.0D + locals.b()), d4 - d2 + 2.0D * (this.g + 100.0D + locals.c()));
    }
    return new Rectangle2D.Double(0.0D, 0.0D, locals.b(), locals.c());
  }
  
  private static final class e_
    implements ac
  {
    final List a = new ArrayList();
    final bc b;
    boolean c;
    
    e_(bc parambc)
    {
      this.b = parambc;
    }
    
    public ac b()
    {
      return new e_(this.b);
    }
    
    public vb a(int paramInt)
    {
      return (vb)this.a.get(paramInt);
    }
    
    public vb a(byte paramByte, int paramInt)
    {
      a_ locala_;
      if (!a.wb) {
        if (this.a.size() > paramInt)
        {
          locala_ = new a_(paramByte, paramInt);
          this.a.add(paramInt, locala_);
          this.c = true;
          return locala_;
        }
      }
      if (this.a.size() == paramInt)
      {
        locala_ = new a_(paramByte, paramInt);
        this.a.add(locala_);
        return locala_;
      }
      throw new IndexOutOfBoundsException();
    }
    
    public void b(int paramInt)
    {
      if (paramInt < this.a.size() - 1) {
        this.c = true;
      }
      a_ locala_ = (a_)this.a.remove(paramInt);
      locala_.e = -1;
    }
    
    public int a()
    {
      return this.a.size();
    }
    
    void d()
    {
      boolean bool2 = a.wb;
      boolean bool1 = a.vb;
      if ((bool2) || (this.c))
      {
        int i = 0;
        if (i < this.a.size()) {}
        while (bool2)
        {
          a_ locala_ = (a_)this.a.get(i);
          locala_.e = i;
          i++;
          if ((!bool2) && (bool1)) {
            return;
          }
          if (!bool1) {
            break;
          }
        }
        this.c = false;
      }
    }
    
    final class a_
      implements vb
    {
      int e;
      bb f = new bb();
      byte h;
      ab j = new ab();
      
      public void b()
      {
        if (!a.wb) {
          if (this.e < 0) {
            throw new IllegalStateException();
          }
        }
        e.e_.this.b(e());
      }
      
      public a_(byte paramByte, int paramInt)
      {
        this.e = paramInt;
        this.h = paramByte;
      }
      
      public void a(a.c.e parame)
      {
        e.a_ locala_ = (e.a_)e.e_.this.b.a(parame);
        locala_.a(this);
        locala_.a(this.f.size());
        this.f.add(parame);
      }
      
      public int e()
      {
        if (!a.wb) {
          if (e.e_.this.c) {
            e.e_.this.d();
          }
        }
        return this.e;
      }
      
      public pc f()
      {
        return null;
      }
      
      public void a(pc parampc) {}
      
      public bb c()
      {
        return this.f;
      }
      
      public byte d()
      {
        return this.h;
      }
      
      public void a(z paramz)
      {
        boolean bool2 = a.wb;
        boolean bool1 = a.vb;
        if (!bool2) {
          if (paramz.size() != this.f.size()) {
            throw new IllegalArgumentException();
          }
        }
        v localv1 = paramz.f();
        v localv2 = this.f.f();
        int i = 0;
        do
        {
          if (localv1 == null) {
            break;
          }
          a.c.e locale = (a.c.e)localv1.c();
          localv2.a(locale);
          e.a_ locala_ = (e.a_)e.e_.this.b.a(locale);
          locala_.a(i);
          i++;
          localv1 = localv1.a();
          localv2 = localv2.a();
        } while (!bool1);
      }
      
      public void b(a.c.e parame)
      {
        boolean bool2 = a.wb;
        boolean bool1 = a.vb;
        int i = 0;
        v localv = this.f.f();
        do
        {
          if (localv == null) {
            break;
          }
          a.c.e locale = (a.c.e)localv.c();
          if ((bool2) || (locale == parame))
          {
            this.f.h(localv);
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            e.a_ locala_ = (e.a_)e.e_.this.b.a(locale);
            locala_.a(i);
            i++;
          }
          localv = localv.a();
        } while (!bool1);
      }
      
      public z a()
      {
        return this.j;
      }
      
      public void a(a.c.d paramd)
      {
        this.j.add(paramd);
      }
    }
  }
  
  private static final class b_
    implements bc
  {
    x a;
    a.c.n b;
    
    public b_(x paramx, a.c.n paramn)
    {
      this.a = paramx;
      this.b = paramn;
    }
    
    public a.f.d.a.y a(a.c.d paramd)
    {
      return (a.f.d.a.y)this.b.get(paramd);
    }
    
    public ec a(a.c.e parame)
    {
      return (ec)this.a.get(parame);
    }
  }
  
  private static class d_
    extends e.c_
    implements e.a_
  {
    z v;
    f[] w;
    final d.tb_ x;
    
    d_(fc paramfc, vc paramvc, d.tb_ paramtb_)
    {
      super(paramvc);
      if (!a.wb)
      {
        if (paramtb_ == null) {
          paramtb_ = d.tb_.g;
        }
        this.x = paramtb_;
      }
    }
    
    public d.tb_ l()
    {
      return this.x;
    }
    
    public byte d()
    {
      return 0;
    }
    
    public v b()
    {
      return (a.wb) || (this.v != null) ? this.v.f() : null;
    }
    
    public v a(a.c.d paramd)
    {
      if (!a.wb) {
        if (this.v == null) {
          this.v = new z();
        }
      }
      return this.v.b(paramd);
    }
    
    public void a(v paramv)
    {
      this.v.h(paramv);
    }
    
    public int c()
    {
      return (a.wb) || (this.v != null) ? this.v.size() : 0;
    }
    
    public f a(int paramInt, zc paramzc)
    {
      boolean bool2 = a.wb;
      boolean bool1 = a.vb;
      if (!bool2) {
        if (this.w == null) {
          this.w = new f[4];
        }
      }
      if (!bool2) {
        if (this.w[paramInt] == null)
        {
          if (!bool2) {}
          switch (paramInt)
          {
          case 0: 
            if (!bool2)
            {
              this.w[paramInt] = new f(0.0D, paramzc.c(), 0.0D);
              if (!bool1) {
                break;
              }
            }
            break;
          case 1: 
            if (!bool2)
            {
              this.w[paramInt] = new f(0.0D, paramzc.d(), paramzc.c());
              if (!bool1) {
                break;
              }
            }
            break;
          case 2: 
            if (!bool2)
            {
              this.w[paramInt] = new f(0.0D, paramzc.c(), paramzc.d());
              if (!bool1) {
                break;
              }
            }
            break;
          case 3: 
            this.w[paramInt] = new f(0.0D, paramzc.d(), 0.0D);
          }
        }
      }
      return this.w[paramInt];
    }
    
    public f b(int paramInt)
    {
      if (!a.wb) {
        if (this.w == null) {
          return null;
        }
      }
      return this.w[paramInt];
    }
  }
  
  private static abstract class c_
    implements e.a_
  {
    vb q;
    int r;
    final fc s;
    vc t;
    a.c.e u;
    
    c_(fc paramfc, vc paramvc)
    {
      this.s = paramfc;
      this.t = paramvc;
    }
    
    public d.tb_ l()
    {
      return d.tb_.g;
    }
    
    public final vc n()
    {
      return this.t;
    }
    
    public final fc m()
    {
      return this.s;
    }
    
    public a.c.d g()
    {
      throw new UnsupportedOperationException();
    }
    
    public a.c.e f()
    {
      throw new UnsupportedOperationException();
    }
    
    public int h()
    {
      return this.q.e();
    }
    
    public a.c.e j()
    {
      return null;
    }
    
    public int i()
    {
      return this.r;
    }
    
    public void b(a.c.d paramd)
    {
      throw new UnsupportedOperationException();
    }
    
    public void b(a.c.e parame)
    {
      throw new UnsupportedOperationException();
    }
    
    public void a(vb paramvb)
    {
      this.q = paramvb;
    }
    
    public void a(int paramInt)
    {
      this.r = paramInt;
    }
    
    public ac k()
    {
      return null;
    }
    
    public Object e()
    {
      return null;
    }
    
    public a.c.e a()
    {
      return this.u;
    }
    
    public void a(a.c.e parame)
    {
      this.u = parame;
    }
    
    public v b()
    {
      return null;
    }
    
    public v a(a.c.d paramd)
    {
      throw new UnsupportedOperationException();
    }
    
    public void a(v paramv)
    {
      throw new UnsupportedOperationException();
    }
    
    public int c()
    {
      return 0;
    }
    
    public f b(int paramInt)
    {
      return null;
    }
    
    public f a(int paramInt, zc paramzc)
    {
      throw new UnsupportedOperationException();
    }
    
    public void a(vc paramvc)
    {
      this.t = paramvc;
    }
  }
  
  private static abstract interface a_
    extends ec
  {
    public abstract void a(vb paramvb);
    
    public abstract void a(int paramInt);
    
    public abstract void a(a.c.e parame);
    
    public abstract void a(vc paramvc);
    
    public abstract v a(a.c.d paramd);
    
    public abstract void a(v paramv);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.i.e

 * JD-Core Version:    0.7.0.1

 */